<extend name="Base/common"/>

<block name="style">
<link href="__CSS__/pzb_stylesheet.css" rel="stylesheet">
</block>

<block name="script">
<script type="text/javascript" src="__JS__/banner.js"></script>
<script type="text/javascript">
var timer;

function countdown(){
	$('.endtime').each(function(){
		var self = $(this), starttime = self.attr('starttime'), endtime = self.attr('endtime');
		
		var nowtime = new Date().getTime();
		starttime = new Date(starttime).getTime();
		endtime = new Date(endtime).getTime();
		overtime = endtime - nowtime;
		if (starttime > nowtime) {
			starttime = new Date(starttime);
			month = starttime.getMonth()+1;
			day = starttime.getDate();
			hour = starttime.getHours();
			minute = starttime.getMinutes();
			self.html('开始时间：' + month + ' 月 ' + day + ' 日 ' + hour + ' 点 ' +minute+' 分');
			//$('.bids a.btn').text(starttime.Format('yyyy-MM-dd hh:mm:ss'));
			//$('.bids a.btn').text( month + ' 月 ' + day + ' 日 ' + hour + ' 点 ' +minute+' 分'+' 开始');
		} else if (overtime > 0) {
			seconds = overtime/1000;
	        minutes = Math.floor(seconds/60);
	        hours = Math.floor(minutes/60);
	        
	        r_second = Math.floor(seconds % 60);
	        r_minute = minutes % 60;
			
			self.html('距结束：' + hours + ' 时 ' + r_minute + ' 分 '+ r_second + ' 秒');
		} else {
			self.html('已结束');
		}
	});
	
	timer = setTimeout("countdown()", 1000);
}

$(function(){
	countdown();
});
</script>
</block>

<block name="header">
<header class="auction">
	<div class="container">
		<div class="logo fl"><img src="__IMG__/pzb/logo.png"></div>
		<div class="sub-nav fl">
			<ul>
	       		<li><a href="{:U('Pzb/index')}">首页</a></li>
	       		<li><a href="{:U('Pzb/index',array('extend'=>'begin'))}">即将开始</a></li>
	       		<li><a href="{:U('Pzb/index',array('extend'=>'end'))}">马上结束</a></li>
	       		<li><a href="{:U('Pzb/index',array('extend'=>'zero'))}">0元起拍</a></li>
	       	</ul>
		</div>
		<div class="search">
			<form action="" method="post" autocomplete="off">
	            <input name="title" class="search-input" placeholder="搜索拍品">
	            <a href="javascript:;" class="search-btn fr">搜索</a>
            </form>
        </div>
	</div>
</header>
<div class="container">
	<div class="sub-menu fl">
		<ul>
			<volist name=":getCategoryTree()" id='vo'>
				<li>
					<a  class="title" href="{:U('index?fid='.$vo['id'])}">{$vo.title}</a>
					<div class="sub-menu-list">
						<volist name="vo._child" id="child">
							 <a href="{:U('index?cid='.$child['id'])}">{$child.title}</a>
					  </volist>
					</div>
				</li>
			</volist>		
		</ul>
	</div>
	<div class="banner">
   		<ul class="banner-img">   			
			<volist name="adlist" id="vo">
				<li><a href="#"><img src="{$vo.image}"></a></li>
			</volist>
   		</ul>
   		<div class="banner-btn"></div>
   		<div class="banner-page">
   			<a href="javascript:;" class="prev"><</a>
   			<a href="javascript:;" class="next">></a>
   		</div>
   	</div>
</div>
</block>

<block name="body">
<div class="container main">
	<div class="col-xs-9 list">
		<div class="row">
			<h4>正在热拍</h4>
			<volist name="p_list" id="vo">
				<div class="form-group auto-overflow">
				<a href="{:U('auctionDetail',array('id'=>$vo['id']))}" class="fl"><img src="{$vo.image}" /></a>
				<div class="fl info">
					<div class="bids"><a href="{:U('auctionDetail',array('id'=>$vo['id']))}" class="btn">{$vo.auction_count}次出价</a></div>
					<div class="title">{$vo.title}</div>
					<div class="desc">
						<p class="price">当前价格：<span class="red">￥{$vo.price}</span></p>
						<p class="time endtime" starttime="{$vo.start_time|time_format='m/d/Y H:s:m'}" endtime="{$vo.end_time|time_format='m/d/Y H:s:m'}">距结束：10 时 10 分 10 秒</p>
					</div>
				</div>
			</div>
			</volist>
		</div>
	</div>
	<div class="col-xs-3 hot">
		<div class="row">
			<h5>拍品推荐</h5>
			<volist name="delicacy_list" id="vo">
			<div class="form-group auto-overflow">
				<a href="{:U('auctionDetail',array('id'=>$vo['id']))}"><img src="{$vo.image}" /></a>
				<div class="fl info">
					<div class="title"><a href="{:U('auctionDetail',array('id'=>$vo['id']))}">{$vo.title}</a></div>
					<div class="desc">
						<div class="bids"><a href="{:U('auctionDetail',array('id'=>$vo['id']))}" class="btn">{$vo.auction_count}次出价</a></div>
						<div class="time endtime" starttime="{$vo.start_time|time_format='m/d/Y H:s:m'}" endtime="{$vo.end_time|time_format='m/d/Y H:s:m'}"></div>
					</div>
				</div>
			</div>
			</volist>	
		</div>
	</div>
</div>
</block>